#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <stdio.h>
int change(int* pa, int* pb, int size)
{
    int i = 0;
    int tmp = 0;
    for (i = 0; i < size; i++)
    {
        tmp = *(pa + i);
        *(pa + i) = *(pb + i);
        *(pb + i) = tmp;

     
    }
}
int main()
{
    char str1[] = "hello bit";
    char str2[] = "123456789";
    printf("%s\n%s", str1, str2);
    printf("\n");
    int size = strlen(str1);
    change(str1, str2, size);
    printf("%s\n%s", str1, str2);
    return 0;
}
#include <stdio.h>
void reverse(int *pb, int size)
{
	int tmp = 0;
	int i = 0;
	for (i = 0; i < (size / 2); i++)
	{
		tmp = *(pb+i);
		*(pb + i) = *(pb + size - 1 - i);
		*(pb + size - 1 - i) = tmp;
	}
}
void init(int *pa, int size)
{
	int i = 0;
	while (i < size)
	{
		*(pa + i) = 0;
		i++;
	}
}
int main()
{
	int arr[10] = { 1,2,3,4,5,6,7,8,9,10 };
	int i = 0;
	int size = sizeof(arr) / sizeof(arr[0]);
	for (i = 0; i < size; i++)
	{
		printf("%d ", arr[i]);

	}

	printf("\n");
	reverse(arr, size);
	for (i = 0; i < size; i++)
	{
		printf("%d ", arr[i]);

	}

	printf("\n");
	init(arr, size);
	for (i = 0; i < size; i++)
	{
		printf("%d ", arr[i]);

	}

	return 0;
}
#include <stdio.h>
void sort(int* pa, int size)
{
	int tmp = 0;
	int i = 0;
	int j = 0;
	for (i = 0; i < size - 1; i++)
	{
		for (j = 0; j < size - 1 - i; j++)
		{
			if (*(pa + j) > *(pa + j + 1))
			{
			   	 tmp = *(pa + j);
		         *(pa + j) = *(pa + j + 1);
				 *(pa + j + 1) = tmp;	
			}
		}
	}
}
int main()
{
	int arr[10] = { 5,7,23,7,9,5,3,4,7,34 };
	int size = sizeof(arr) / sizeof(arr[0]);
	int i = 0;
    for (i = 0; i < size; i++)
	    {
		   printf("%d ", arr[i]);
	    }

	sort(arr, size);
	printf("\n");
	for (i = 0; i < size; i++)
	{
		printf("%d ", arr[i]);
	}

	return 0;
}